//判断cook是否登录
function ck(key){
    var ckl=document.cookie
    var arr=ckl.split('; ')
    for(var i=0;i<arr.length;i++){
        var zhong1=arr[i].split('=')
        if(zhong1[0]==key){
             var deng1=document.getElementById('deng1')
             deng1.innerHTML="欢迎"+zhong1[1]
        }
    }
}
ck('name')
function lun1(){
	var som=0
	dsq1=setInterval(()=>{
	som++
	if(som>4){
		$('.toulun').css('top',-35)
		som=2
	}
	$('.toulun').animate({top:-som*35},500)
},2000)
}
lun1()

var dao1=document.querySelector('.daobox')
window.onscroll=function(){
	let gun1=window.pageYOffset
	
	if(gun1>100){
		dao1.style.position='fixed'
		dao1.style.borderBottom='3px solid #000'
		dao1.style.zIndex='5'
	}else{
		dao1.style.position=''
		dao1.style.border=''
		dao1.style.zIndex=''
	}
}
//鼠标移入事件
var boy1=document.body
var $xian1=$('.shou12_yi>:nth-child(2)')
var yi1=document.querySelector('.shou12>:nth-child(1)')
var yi2=document.querySelector('.shou12>:nth-child(2)')
yi1.onmousemove=function(){
	$('.shou12_yi>:nth-child(1)').css({display:'block',zIndex:8})
}
yi1.onmouseout=function(){
	$('.shou12_yi>:nth-child(1)').css({display:'none'})
}

// 移入2
yi2.onmousemove=function(){
	$('.shou12_yi>:nth-child(2)').css({display:'block'})
}
yi2.onmouseout=function(){

		$('.shou12_yi>:nth-child(2)').css({display:'none'})

}
var yi22=document.querySelector('.shou12_yi>:nth-child(2)')
yi22.onmouseenter=function(){
	yi22.style.display='block'
}
yi22.onmouseleave=function(){
	yi22.style.display='none'
}

// $a=0
// $('.shanri>:last-child>:last-child').on('click',function(){
// 	$('.shanri>:last-child>:last-child').prev().html(++$a)
// })
function yun1(){
	var jia=document.querySelectorAll('.shanri>:last-child>:last-child')
	for(let i=0;i<jia.length;i++){
		jia[i].onclick=function(){
			var shu=jia[i].previousElementSibling.innerHTML
			shu++
			jia[i].previousElementSibling.innerHTML=shu
		}
	}
}
yun1()

// var a=0
// var b=0
// //轮播
// function tuluu(obj){
// 	function tulun1(obj){
// 		a++
// 		if(a>2){
// 			a=0
// 		}
// 		$(obj).eq(a).css('left','100%')
// 		$(obj).eq(a).animate({left:0},500)
// 		$(obj).eq(b).animate({left:'-100%'},500)
// 		b=a
// 		console.log(a)
// 	}
// 	tulun1(obj)
//  setInterval(tulun1,3000)
// }
// tuluu('.nr-2>:nth-child(7) img')
var a=0
var b=0
function lun3(){
	a++
	if(a>1){
		a=0
	}
	$('.nr-2>:nth-child(7) img').eq(a).css('left','100%')
	$('.nr-2>:nth-child(7) img').eq(a).animate({left:0},500)
	$('.nr-2>:nth-child(7) img').eq(b).animate({left:'-100%'},500)
	$('.nr-2>:nth-child(6) img').eq(a).css('left','100%')
	$('.nr-2>:nth-child(6) img').eq(a).animate({left:0},500)
	$('.nr-2>:nth-child(6) img').eq(b).animate({left:'-100%'},500)
	$('.nr-2>:nth-child(5) img').eq(a).css('left','100%')
	$('.nr-2>:nth-child(5) img').eq(a).animate({left:0},500)
	$('.nr-2>:nth-child(5) img').eq(b).animate({left:'-100%'},500)
	$('.nr-2>:nth-child(4) img').eq(a).css('left','100%')
	$('.nr-2>:nth-child(4) img').eq(a).animate({left:0},500)
	$('.nr-2>:nth-child(4) img').eq(b).animate({left:'-100%'},500)
	$('.nr-2>:nth-child(3) img').eq(a).css('left','100%')
	$('.nr-2>:nth-child(3) img').eq(a).animate({left:0},500)
	$('.nr-2>:nth-child(3) img').eq(b).animate({left:'-100%'},500)
	$('.nr-2>:nth-child(2) img').eq(a).css('left','100%')
	$('.nr-2>:nth-child(2) img').eq(a).animate({left:0},500)
	$('.nr-2>:nth-child(2) img').eq(b).animate({left:'-100%'},500)
	b=a
}
lun3()
setInterval(lun3,2000)